package com.eastfair.config.service;

import com.eastfair.boot.service.SuperCacheService;
import com.eastfair.config.dto.AttachmentDTO;
import com.eastfair.config.entity.Attachment;
import com.eastfair.config.vo.AttachmentVO;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 附件资源管理
 * </p>
 *
 * @author zjn
 * @date 2021-08-31
 */
public interface AttachmentService extends SuperCacheService<Attachment> {

    /**
     * 批量新增附件
     *
     * @param attachmentDTOList 附件列表
     * @return 是否新增成功
     */
    Boolean saveAttachmentList(List<AttachmentDTO> attachmentDTOList);

    /**
     * 批量删除业务附件
     *
     * @param attachmentDTO 业务类型、业务id
     * @return 是否删除成功
     */
    Boolean deleteByBusiness(AttachmentDTO attachmentDTO);

    /**
     * 根据业务id与业务类型批量删除原附件后批量新增附件
     *
     * @param attachmentDTOList 新附件列表
     * @return 是否操作成功
     */
    Boolean deleteAndSaveAttachmentList(List<AttachmentDTO> attachmentDTOList);

    /**
     * 根据业务id与业务类型查询附件
     *
     * @param attachmentDTO 查询条件
     * @return 附件列表
     */
    List<AttachmentVO> getAttachmentListByBusiness(AttachmentDTO attachmentDTO);
}
